home *** CD-ROM | disk | FTP | other *** search
/ Guide To Cracking 2002 / Guide_to_Cracking_2002.iso / Tutorials / Nag and Time Trial / nag / ns02.txt < prev    next >
Encoding:
Text File  |  1999-11-23  |  8.2 KB  |  184 lines

  1. Bassline.WinPopup.v2.54a Cracking Tutorial by UFK updated in 03/21/99
  2. -----------------------------------------------------------------------
  3.  
  4. Hiya people. This program doesn't have a really hard protection but it 
  5. still has something that can give you some new ideas about cracking. 
  6. in here it's a 50 days trial program with 2 nag screens. ok now lets work.
  7.  
  8. i wanna thank to _y for helping me in this tutorial and for making
  9. lamerslog worth looking at :) 
  10.  
  11. another big thanks to ytc Neural and iczelion!
  12.  
  13. Execute the program! wow! amazing!
  14. i get a message "Messanger Service or another WinPopUp might be running. 
  15. Reciver was Disabled!" ok that's got nothing to do with me, 
  16. and you'll probebly won't even get this one. ok next!
  17. ok now i see "You have 50 days to evaluate this software, 
  18. would you bla bla bla.. ".
  19. Run IDA and start disassembling it. wait for it to finish :)
  20. now we can't search for "you have 50 days.." cause 50 get changes
  21. in each day. so lets do a binary search just for "you have".
  22.  
  23. .data:0046A250 59 6F 75 20 68 61+str->YouHaveDDaysToE db 'You have %d\
  24.  days to evaluate this software',0
  25. .data:0046A250 76 65 20 25 64 20+
  26. .data:0046A27B 0
  27.  
  28. cool! next! now we can't get this program registered.. at least
  29. in the easy way cause when i searched for the word "registered"
  30. i found nothing. so what we're gonna do is to find the call that
  31. creates the window and we eliminate it with nops.
  32. so first press on the X-Ref to that string, to see what's using it.
  33.                         _||_                     
  34. (the X-Ref points here) \  /
  35.                          \/
  36. .text:004020AF 68 50 A2 46 00        push offset str->YouHaveDDaysToE 
  37. (our string)
  38. .text:004020B4 52            push edx
  39. .text:004020B5 E8 F8 B5 02 00        call _text_42D6B2
  40. .text:004020BA 83 C4 0C            add esp, 0Ch
  41. .text:004020BD                 _text_4020BD:
  42. .text:004020BD 68 18 A2 46 00        push offset str->WouldYouSeeTheR 
  43. (the rest of the nag screen text)
  44. .text:004020C2 8D 4C 24 30        lea ecx, [esp+2Ch+arg_0]
  45. .text:004020C6 E8 64 D5 02 00        call _text_42F62F
  46. .text:004020CB 8B 86 18 03 00 00    mov eax, [esi+318h]
  47.  
  48. ok so run softice symbol loader. load our program and when it breaks on
  49. the 1st line of the program create a break point on the address "4020AF"
  50. and we'll go step by step by using the s-ice command P or F10 
  51. (Step Skipping Calls, Ints, Etc) till it will show us the nag so
  52. we'll know what command creates it. we press F10 a few times
  53. till we get the nag screen, now it asks us if we want to view
  54. the WWW pages. we say no. and then SoftIce Pops up and we see
  55. a call to some address. means this is the nag screen creator! yuck! :D
  56. lets delete it. we see in softice that it's address is 001B:004020F2.
  57. and when you jump to it with IDA you see this:
  58.  
  59. .text:004020F2 E8 61 DA 03 00        call _text_43FB58
  60. .text:004020F7 83 F8 06            cmp eax, 6
  61. .text:004020FA 75 07            jnz short _text_402103
  62.  
  63. cool so now run an hex editor and go to this address, you can do that
  64. by searching for the hex values of the call command or just
  65. using the exelent program by Iczelion called "Virtual Address to File Offset"
  66. that you can get from iczelion.cjb.net. in there you just write the memory
  67. address and it gives you the files offset. so the file offset of the
  68. call command is $14F2. so use an hex editor and go to that place.
  69. (save a backup of your original exe file 1st). now change all of the
  70. hex numbers of this command to nops. (nop in asm means do nothing
  71. and it's hex value is 90h) so make it look like that:
  72.  
  73. .text:004020F2 90            nop
  74. .text:004020F3 90            nop
  75. .text:004020F4 90            nop
  76. .text:004020F5 90            nop
  77. .text:004020F6 90            nop
  78. .text:004020F7 83 F8 06            cmp eax, 6
  79. .text:004020FA 75 07            jnz short _text_402103
  80.  
  81. now save it and run the program, lets see what happends.
  82. damn! it crushes!! why???!?!! well that's something that can help
  83. you in the future. it seems that in this program the function
  84. that creates a nag returns a value that something else uses so if we
  85. eliminate this thingy and it returns nothing so the program crushes!
  86. what do we do? break on that command, press F10 and in softice
  87. any register that got changed is in a light blue color (maybe
  88. in your computer it's in a different color). so just copy
  89. all of this registeres and their numbers to a paper. lets do that 1st.
  90. ok so run the symbol loader, make a breakpoint on 004020F2
  91. (of course you need to reload the file again cause you changed it).
  92. now it broke ? press F10 once and after that copy all the registers
  93. that got changed, again they'll be highlighted with some color.
  94. in my computer this is what that got changed:
  95.  
  96. EAX=00000007
  97. ECX=0012FD4C
  98. ESP=0012FD30
  99. EDX=00020000
  100. EIP=004020F7
  101.  
  102. well it's not EIP!
  103. EIP = extended instruction pointer, points to the current instruction.
  104.  
  105. ok now lets look at our code.
  106.  
  107. .text:004020F2 E8 61 DA 03 00        call _text_43FB58 <- rans NAG
  108. .text:004020F7 83 F8 06            cmp eax, 6
  109. .text:004020FA 75 07            jnz short _text_402103 <- if Zero
  110. .text:004020FE E8 0D FC FF FF        call _text_401D10         Flag on
  111. .text:00402103                 _text_402103:             so show
  112. .text:00402103 39 9E 18 03 00 00    cmp [esi+318h], ebx       www pages.
  113. .text:00402109 7D 1B            jge short _text_402126
  114.  
  115. i commented where it checks if you wanna view the www pages or not.
  116. there's not much to explane if you'll break on that line and change
  117. the zero flag you'll notice it yourself :) now when it comes to jge
  118. it jmps. so it jumps here:
  119.  
  120. .text:00402126                _text_402126:
  121. .text:00402126 8D 4C 24 2C        lea ecx, [esp+28h+arg_0]
  122. .text:0040212A 88 5C 24 24        mov byte ptr [esp+28h+var_4], bl
  123. .text:0040212E E8 60 D1 02 00        call _text_42F293
  124.  
  125. now when you'll keep tracing you see that it crushes on 
  126. .text:0040212E E8 60 D1 02 00        call _text_42F293
  127.  
  128. so lets see what registers it used so far! remember! the registers
  129. that got changed are: Eax, Ecx, Esp, Edx and EIP.
  130.  
  131. ok in here:
  132. .text:004020F7 83 F8 06            cmp eax, 6
  133. we see that eax is for checking if you wanna view the WWW file so
  134. that's not our register.
  135.  
  136. in here: .text:00402126 8D 4C 24 2C        lea ecx, [esp+28h+arg_0]
  137. we see that it loads something to ecx, so that's not our register.
  138.  
  139. what got left is ESP, EDX and EIP. i told you why it's not EIP
  140. so what left is ESP and EDX. i don't see that this program uses
  141. EDX anywhere so what got left is ESP :) so what does it mean?
  142. it means that the program uses the data in ESP register
  143. that got returned from the procedure that makes the nag.
  144. so instead of noping the call, change it to "mov esp, 0012fd30"
  145. and fill the rest with nops. now run an hex editor and go to 14f2h.
  146. now notice that the call command takes 5 bytes. change to what
  147. we need. now we see that our mov command takes 5 bytes too so we 
  148. don't need to nop anything. if the mov command took only 4 bytes
  149. and we wouldn't nop the 5th byte so it would create a big mass.
  150. ok so now it's like that:
  151.  
  152. .text:004020F2 BC 30 FD 12 00        mov esp, 0012fd30
  153. .text:004020F7 83 F8 06            cmp eax, 6
  154. .text:004020FA 75 07            jnz short _text_402103 
  155.  
  156. cool! we don't need to worry about eax cause it will never be 6
  157. so it will never show the WWW pages, if you're so worried so
  158. change the jnz to jmp! :D ok now run the program and see what happends.
  159. works great! no nag! but it's not enouge! we removed the regular nag
  160. but what about the nag when the evalution days are over?
  161. change the date to a year after or something, run the program and what
  162. do you see? the program just quits. no nag no nothing, why?
  163. because welp.. remember that it asks if you wanna view the WWW pages?
  164. well it uses the same thingy for both of the nags and when we eliminated
  165. it we eliminated both of the nags. so what can we do now? go back to
  166. the start :) use your original version of the file to find out
  167. what else to change. ok now run the program and what nag appears?
  168. "This program has expired". good, do a binary search in IDA.
  169. and of course we found it! press on it's X-Ref and it get used from here:
  170. .text:00402098 7D 10            jge short _text_4020AA
  171. .text:0040209A 68 7C A2 46 00        push offset str->ThisProgramHasE
  172.  
  173. cool.. just above it there is a jge. what if we'll change this jge
  174. to "jmp"? lets try! 1st run softice, break on this address and change
  175. the flags so it will jmp. means turn the S flag off.
  176. what do we see? well i see a nice nag "you have -317 days left to evaluate.."
  177. neat! means we change that jmp and eliminate the nag like i explaned
  178. at first and we're all done! :D hope it helped you out. bu-bye!
  179.  
  180. don't forget to e-mail for suggestions and stuff.
  181. ufk@hotmail.com
  182. ICQ:1416041
  183. Irc Nick: UFK
  184.